package grape.sequence.service.generator.dbbased;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by yangwei
 * Created at 2020/8/21 14:55
 */
@Data
public class GeneratorInsertPo {

    private Long id;
    private String createAt;
    private String tableName;

    List<String> stepNums;

    /**
     * 初始化步长
     * @param step
     */
    public void initStepNums(Integer step) {
        if (step > 1) {
            stepNums = new ArrayList<>();
            for (int i = 0; i < step - 1; i++) {
                stepNums.add(createAt);
            }
        }
    }

}
